package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SumAlertMapper;
import com.ruoyi.system.domain.SumAlert;
import com.ruoyi.system.service.ISumAlertService;
import com.ruoyi.common.core.text.Convert;

/**
 * 个人总结Service业务层处理
 * 
 * @author pluto_xun@qq.com
 * @date 2020-12-11
 */
@Service
public class SumAlertServiceImpl implements ISumAlertService 
{
    @Autowired
    private SumAlertMapper sumAlertMapper;

    /**
     * 查询个人总结
     * 
     * @param alertId 个人总结ID
     * @return 个人总结
     */
    @Override
    public SumAlert selectSumAlertById(Long alertId)
    {
        return sumAlertMapper.selectSumAlertById(alertId);
    }

    /**
     * 查询个人总结列表
     * 
     * @param sumAlert 个人总结
     * @return 个人总结
     */
    @Override
    public List<SumAlert> selectSumAlertList(SumAlert sumAlert)
    {
        return sumAlertMapper.selectSumAlertList(sumAlert);
    }

    /**
     * 新增个人总结
     * 
     * @param sumAlert 个人总结
     * @return 结果
     */
    @Override
    public int insertSumAlert(SumAlert sumAlert)
    {
        sumAlert.setCreateTime(DateUtils.getNowDate());
        return sumAlertMapper.insertSumAlert(sumAlert);
    }

    /**
     * 修改个人总结
     * 
     * @param sumAlert 个人总结
     * @return 结果
     */
    @Override
    public int updateSumAlert(SumAlert sumAlert)
    {
        sumAlert.setUpdateTime(DateUtils.getNowDate());
        return sumAlertMapper.updateSumAlert(sumAlert);
    }

    /**
     * 删除个人总结对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSumAlertByIds(String ids)
    {
        return sumAlertMapper.deleteSumAlertByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除个人总结信息
     * 
     * @param alertId 个人总结ID
     * @return 结果
     */
    @Override
    public int deleteSumAlertById(Long alertId)
    {
        return sumAlertMapper.deleteSumAlertById(alertId);
    }
}
